function save_data_to_txt_file(signal,len,name)
    if nargin == 2
        name = 'Mytest_';
    end
    signal_i = real(signal(1:len));
    signal_q = imag(signal(1:len));
    tt = zeros(2*len,1);
    tt(1:2:2*len) = signal_i;
    tt(2:2:2*len) = signal_q;
    tt = floor(tt);
    ttt = dec2bin(tt);
    tttt = [];
    for i = 1:length(ttt)
        tttt =[tttt;convertCharsToStrings(ttt(i,5:end))];
    end
    matname = ['./testdata_',name,'.mat'];
    save(matname,'signal');
    filename = ['D:/DATA/doctor/QPSK/QPSK_IMPLEMENTATION_USING_AD9361/test/testdata_',name,'.txt'];
    fileid = fopen(filename,'w');
    fprintf(fileid,'%s\r\n',tttt);
    fclose(fileid);
    
    filename = ['D:/DATA/doctor/QPSK/QPSK_IMPLEMENTATION_USING_AD9361/test/testresult_',name,'.txt'];
    fileid = fopen(filename,'w');
    fclose(fileid);
end

